package view.inventory.menu
{
import core.Language;

import framework.view.components.button.ButtonProxy;

import values.item.SkillBookItemValue;
import values.skill.SkillTemplateValueList;
import values.skill.SkillValue;

/**
 * InventorySkillBookItemMenuProxy
 * @author jliang
 *
 */
public class InventorySkillBookItemMenuProxy extends InventoryItemMenuProxy
{
    //==========================================================================
    //  Constructor
    //==========================================================================
    public function InventorySkillBookItemMenuProxy()
    {
        super();
    }
    //==========================================================================
    //  Overridden methods: ComponentProxy
    //==========================================================================	
    override protected function get proxyMapping():Array
    {
        return [ 
            { skin:"useBtn", classRef: ButtonProxy, id:"useBtn", text:Language.getText("@use_skill_book_button_label"), onClick: useHandler }
        ].concat(super.proxyMapping);
    }	
    //==========================================================================
    //  Event handlers
    //==========================================================================
    protected function useHandler():void
    {
        var sb:SkillBookItemValue = SkillBookItemValue(data);
        trace("学习 <" + sb.name + ">, 使技能 <" + SkillTemplateValueList.getByKey(sb.skillKey).name + "> 到达 " + sb.skillLevel + " 级");
    }
}
}